import request from '../utils/request';
import { cloud } from '../utils/config';

  export async function queryAll () {
    return request(`${cloud}/billUphold/billUpholds`,{
        method: 'get',
        cors:true
      }
    )
  }

  export async function remove (data) {
    const id = data.payload.id;
    return request( `${cloud}/billUphold/delete/:${id}`, {
      method:'delete'
    })
  }

  export async function query (payload) {
    return request(`${cloud}/billUphold/billUpholds`,{
        method: 'post',
      }
    )
  }

  export async function create (payload) {
    return request(`${cloud}/billUphold/create`,{
        method: 'post',
        body: JSON.stringify(payload),
        data: JSON.stringify(payload),
      }
    )
  }

  export async function update (payload) {
    return request(`${cloud}/billUphold/update`,{
        method: 'put',
        body: JSON.stringify(payload),
        data: JSON.stringify(payload),
      }
    )
  }
